Repository navigation
feat(sidebar): sort workspaces and pin them to the top - #272
Merged
andrebrait merged 2 commits intoOct 22, 2026
Merged
Conversation
Add a sort menu beside the workspace search (None, Alphabetical, Last updated) and, while a sort is active, a pin toggle per workspace. Pinned workspaces lead in their own manual order (pinOrder in projects.json); unpinned ones follow the sort and lose Move up/down and drag. Last updated uses the last message time from the session tail scan (SessionInfo.lastMessageAt), falling back to the file mtime.
… frozen order in an effect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #271.
Problem
Workspaces could only be ordered by hand (or by when they were added). There was no way to keep the workspaces you are working on at the top, either automatically by activity or by pinning them.
Changes
omp-web:project-sortinlocalStorage). The button is a menu trigger (aria-haspopup/aria-expanded). The menu opens on the checked option and returns focus to the button when it closes.…button. Pinned workspaces stay at the top in their own manual order, unaffected by the sort. A newly pinned workspace goes to the end of the pinned group. While a sort is active, only pinned workspaces keep Move up, Move down and dragging; unpinned ones follow the sort. Under None, pins are ignored and the manual order applies unchanged.pinOrderis stored inprojects.jsonnext tosortOrder.PATCH /api/projectsaccepts it (a number, ornullto unpin), and a bad value returnsinvalid_pin_order. Pin and reorder writes are serialized, so a click based on a list that has not reloaded yet cannot undo the previous write.SessionInfo.lastMessageAt. "Last updated" uses it, falling back to the file mtime, so a rename or auto-name does not move a workspace to the top.Verification
aria-pressedset.…menu lacked Move up/down, while a pinned row had them.lib/project-ordering.test.mjs: every mode with pins; the newest session per workspace wins; the last message time beats mtime; case-insensitive and numeric names; where a new pin goes.lib/project-registry.test.mjs: pin and unpin round trip.lib/session-reader.test.mjs:lastMessageAtis taken from the tail and is not moved by a latertitle_change.npm test,npm run lint(no errors) andtsc --noEmitpass.